//
//  LineLabel.m
//  SXH
//
//  Created by Ryan on 16/6/14.
//  Copyright © 2016年 lyss. All rights reserved.
//

#import "LineLabel.h"

@implementation LineLabel

- (void)drawRect:(CGRect)rect

{
    
    if (self.isWithStrikeThrough)
        
    {
        
        
        
        CGContextRef c =UIGraphicsGetCurrentContext();
        
        
        
        CGFloat red[4] = {1.0f,1.0f,1.0f,1.f};//白色
        
        //CGFloat black[4] = {0.0f, 0.0f, 0.0f, 0.5f};//黑色
        
        CGContextSetStrokeColor(c, red);
        
        CGContextSetLineWidth(c,1);
        
        CGContextBeginPath(c);
        
        //画直线
        
//        CGFloat halfWayUp = rect.size.height/2 + rect.origin.y;
//        
//        CGContextMoveToPoint(c, rect.origin.x, halfWayUp );//开始点
//        
//        CGContextAddLineToPoint(c, rect.origin.x + rect.size.width, halfWayUp);//结束点
        
        //画斜线
        
                CGContextMoveToPoint(c, rect.origin.x, rect.origin.y+rect.size.height-10 );
        
                CGContextAddLineToPoint(c, (rect.origin.x + rect.size.width), rect.origin.y +10); //斜线
        
        CGContextStrokePath(c);
        
    }
    
    
    
    [super drawRect:rect];
    
}
@end
